package com.kksoft.readcm.activity;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Picture;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.util.DisplayMetrics;
import android.view.*;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.DownloadListener;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebChromeClient.CustomViewCallback;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebView.PictureListener;
import android.webkit.WebViewClient;
import android.widget.*;
import com.kksoft.readcm.pro.R;
import com.kksoft.readcm.a.*;
import com.kksoft.readcm.c.b;
import com.kksoft.readcm.d.i;
import com.kksoft.readcm.objects.*;
import com.kksoft.readcm.objects.y;
import com.kksoft.readcm.views.*;
import com.kksoft.readcm.views.aa;
import com.kksoft.readcm.views.x;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;

// Referenced classes of package com.kksoft.readcm.activity:
//            RilAppActivity, au, App, dy, 
//            dx, av, cj, cl, 
//            eg, cr, cq, cs, 
//            ea, dz, ee, bi, 
//            dn, LoadingListActivity, EditItemActivity, eb, 
//            HomeActivity, be, bb, ba, 
//            aq, bd, bc, aw, 
//            ax, ck, cn, cm, 
//            cp, co, ed, ec, 
//            g, ef

public class ReaderActivity extends RilAppActivity
    implements b
{

    public ReaderActivity()
    {
        c = null;
        d = null;
        e = null;
        f = null;
        h = null;
        a = null;
        i = null;
        j = null;
        k = null;
        l = null;
        m = null;
        n = null;
        o = null;
        p = null;
        z = null;
        A = null;
        B = null;
        C = null;
        ArrayList arraylist = new ArrayList();
        D = arraylist;
        b = null;
        F = null;
        G = null;
        H = null;
        I = null;
        J = null;
        R1 = false;
        AtomicInteger atomicinteger = new AtomicInteger(0);
        S = atomicinteger;
        T = false;
        U = false;
        V = false;
        W = false;
        X = null;
        Y = false;
        aa = 0;
    }

    static int A(ReaderActivity readeractivity)
    {
        return readeractivity.n();
    }

    static void B(ReaderActivity readeractivity)
    {
        readeractivity.a(false, false);
    }

    static boolean C(ReaderActivity readeractivity)
    {
		return true;
//        if(readeractivity.T || !readeractivity.V || readeractivity.a.getContentHeight() <= 0 || readeractivity.Y)
//            break MISSING_BLOCK_LABEL_221;
//        readeractivity.T = true;
//        if(readeractivity.M == null || !readeractivity.M.t()) goto _L2; else goto _L1
//_L1:
//        boolean flag;
//        l l1 = readeractivity.M;
//        int i1 = readeractivity.S.get();
//        flag = l1.a(i1);
//        if(flag == null) goto _L2; else goto _L3
//_L3:
//        if(readeractivity.S.get() != 1) goto _L5; else goto _L4
//_L4:
//        readeractivity.a.scrollTo(0, 0);
//        Object aobj[] = new Object[2];
//        Integer integer = Integer.valueOf(flag.b());
//        aobj[0] = integer;
//        Integer integer1 = Integer.valueOf(flag.d());
//        aobj[1] = integer1;
//        String s1 = String.format("javascript:scrollToNodeIndex(%s, %s)", aobj);
//        readeractivity.a.loadUrl(s1);
//_L2:
//        flag = true;
//_L8:
//        return flag;
//_L5:
//        if(flag.e() <= 1) goto _L2; else goto _L6
//_L6:
//        flag = flag.e();
//        flag;
//        JVM INSTR ifle 151;
//           goto _L7 _L2
//_L7:
//        double d1 = readeractivity.r();
//        double d2 = (double)flag / 100D;
//        int j1 = (int)Math.round(d1 * d2);
//        readeractivity.a.scrollTo(1, j1);
//        readeractivity.a.scrollTo(1, j1);
//          goto _L2
//        flag = false;
//          goto _L8
    }

    static void D(ReaderActivity readeractivity)
    {
    	ItemAppObservable e1 = com.kksoft.readcm.a.Appconfig.getThis().getItemAppObservable();
        e1.a(readeractivity.M, false, true);
        readeractivity.finish();
    }

    static void E(ReaderActivity readeractivity)
    {
        if(!readeractivity.h())
        {
            readeractivity.i();
        } else
        {
            ArrayList arraylist = readeractivity.D;
            int i1 = readeractivity.D.size() - 1;
            Object obj = arraylist.remove(i1);
            ArrayList arraylist1 = readeractivity.D;
            int j1 = readeractivity.D.size() - 1;
            String s1 = (String)arraylist1.get(j1);
            readeractivity.a(s1, ((l) (null)), false);
        }
    }

    static void F(ReaderActivity readeractivity)
    {
        readeractivity.a(readeractivity.N, readeractivity.M);
    }

    static p G(ReaderActivity readeractivity)
    {
        return readeractivity.C;
    }

    static boolean H(ReaderActivity readeractivity)
    {
        return readeractivity.ad;
    }

    static void I(ReaderActivity readeractivity)
    {
        readeractivity.c(-1);
    }

    static void J(ReaderActivity readeractivity)
    {
        readeractivity.c(1);
    }

    static void K(ReaderActivity readeractivity)
    {
        boolean s1;
        Object aobj[];
        int i1;
        String s2;
        String s3;
        if(readeractivity.am)
            s1 = false;
        else
            s1 = true;
        readeractivity.am = s1;
        aobj = new Object[1];
        if(readeractivity.am)
            i1 = 1;
        else
            i1 = 0;
        s2 = String.valueOf(i1);
        aobj[0] = s2;
        s3 = String.format("javascript:newFontType(%s)", aobj);
        readeractivity.a.loadUrl(s3);
        readeractivity.p();
    }

    static void L(ReaderActivity readeractivity)
    {
        boolean s1;
        Object aobj[];
        int i1;
        String s2;
        String s3;
        if(readeractivity.ak)
            s1 = false;
        else
            s1 = true;
        readeractivity.ak = s1;
        aobj = new Object[1];
        if(readeractivity.ak)
            i1 = 1;
        else
            i1 = 0;
        s2 = String.valueOf(i1);
        aobj[0] = s2;
        s3 = String.format("javascript:newTextAlign(%s)", aobj);
        readeractivity.a.loadUrl(s3);
        readeractivity.p();
    }

    static void M(ReaderActivity readeractivity)
    {
        boolean s1;
        Object aobj[];
        int i1;
        String s2;
        String s3;
        if(readeractivity.al)
            s1 = false;
        else
            s1 = true;
        readeractivity.al = s1;
        aobj = new Object[1];
        if(readeractivity.al)
            i1 = 1;
        else
            i1 = 0;
        s2 = String.valueOf(i1);
        aobj[0] = s2;
        s3 = String.format("javascript:newTextStyle(%s)", aobj);
        readeractivity.a.loadUrl(s3);
        readeractivity.p();
    }

    static void N(ReaderActivity readeractivity)
    {
        readeractivity.k();
    }

    static void O(ReaderActivity readeractivity)
    {
        readeractivity.g();
    }

    private static String a(l l1, String s1)
    {
        String s2;
        if(l1 != null)
            s2 = l1.l();
        else
        if(s1 != null)
            s2 = s1;
        else
            s2 = "";
        return s2;
    }

    static AtomicInteger a(ReaderActivity readeractivity)
    {
        return readeractivity.S;
    }

    private void a(int i1)
    {
        S.set(i1);
        if(a != null)
        {
            WebSettings websettings = a.getSettings();
            boolean flag;
            if(i1 == 2)
                flag = true;
            else
                flag = false;
            websettings.setBuiltInZoomControls(flag);
        }
    }

    private void a(int i1, int j1)
    {
        int k1;
        if(i1 >= 23)
            k1 = 23;
        else
        if(i1 <= 8)
            k1 = 8;
        else
            k1 = i1;
        if(k1 == 23)
        {
            G.setEnabled(false);
            G.setAlpha(102);
        } else
        if(k1 == 8)
        {
            F.setEnabled(false);
            F.setAlpha(102);
        } else
        {
            G.setEnabled(true);
            G.setAlpha(255);
            F.setEnabled(true);
            F.setAlpha(255);
        }
        if(k1 != j1)
        {
            aj = k1;
            Object aobj[] = new Object[1];
            String s1 = String.valueOf(k1);
            aobj[0] = s1;
            String s2 = String.format("javascript:newFontSize(%s)", aobj);
            a.loadUrl(s2);
        }
    }

    private void a(int i1, boolean flag, boolean flag1)
    {
//        int j1 = S.get();
//        if(i1 != j1 && (i1 == 1 || i1 == 2)) goto _L2; else goto _L1
//_L1:
//        return;
//_L2:
//        E = flag;
//        a(i1);
//        g();
//        if(flag1)
//        {
//            Toggle toggle = A;
//            boolean flag2;
//            if(S.get() == 1)
//                flag2 = true;
//            else
//                flag2 = false;
//            toggle.a(flag2, true);
//        }
//        if(true) goto _L1; else goto _L3
//_L3:
    }

    static void a(ReaderActivity readeractivity, float f1)
    {
        readeractivity.ae = f1;
    }

    static void a(ReaderActivity readeractivity, int i1)
    {
        readeractivity.ah = i1;
    }

    static void a(ReaderActivity readeractivity, android.webkit.WebChromeClient.CustomViewCallback customviewcallback)
    {
        readeractivity.g = customviewcallback;
    }

    static void a(ReaderActivity readeractivity, LinearLayout linearlayout)
    {
        readeractivity.e = linearlayout;
    }

    static void a(ReaderActivity readeractivity, VideoView videoview)
    {
        readeractivity.f = videoview;
    }

    static void a(ReaderActivity readeractivity, j j1)
    {
//_L2:
//        return;
//        if(!readeractivity.V || readeractivity.S.get() != 1 || j1 == null || readeractivity.ab == null) goto _L2; else goto _L1
//_L1:
//        String s1 = j1.j();
//        String s2 = readeractivity.m();
//        if(s1.equals(s2))
//        {
//            HashMap hashmap = readeractivity.ab;
//            Integer integer = Integer.valueOf(j1.l());
//            Object obj = (q)hashmap.get(integer);
//            if(obj != null)
//            {
//                StringBuilder stringbuilder = new StringBuilder("javascript:loadImage('");
//                int i1 = j1.l();
//                StringBuilder stringbuilder1 = stringbuilder.append(i1).append("', ").append("'");
//                String s3 = com.kksoft.readcm.a.c.c(j1.k());
//                StringBuilder stringbuilder2 = stringbuilder1.append(s3).append("', ").append("'");
//                String s4;
//                StringBuilder stringbuilder3;
//                float f1;
//                String s5;
//                if(((q) (obj)).d() != null)
//                    s4 = ((q) (obj)).d();
//                else
//                    s4 = "";
//                stringbuilder2 = stringbuilder2.append(s4).append("', ").append("'");
//                if(((q) (obj)).c() != null)
//                    obj = ((q) (obj)).c();
//                else
//                    obj = "";
//                stringbuilder3 = stringbuilder2.append(((String) (obj))).append("', ").append("'");
//                f1 = readeractivity.o();
//                s5 = stringbuilder3.append(f1).append("',").append("'0')").toString();
//                readeractivity.a.loadUrl(s5);
//            }
//        }
//        if(true) goto _L2; else goto _L3
//_L3:
    }

    static void a(ReaderActivity readeractivity, p p1)
    {
        readeractivity.C = p1;
    }

    static void a(ReaderActivity readeractivity, final String s1)
    {
//        readeractivity.j.a();
//        String s2;
//        String s3;
//        String s4;
//        au au1;
//        if(readeractivity.M != null)
//            s2 = readeractivity.M.l();
//        else
//            s2 = readeractivity.N;
//        readeractivity.j.a(s2);
//        ErrorScreen errorscreen1 = readeractivity.j;
//        s3 = readeractivity.getString(0x7f0700de);
//        errorscreen1.c(s3);
//        ErrorScreen errorscreen2 = readeractivity.j;
//        s4 = readeractivity.getString(0x7f0700df);
//        errorscreen2.d(s4);
//        ErrorScreen errorscreen3 = readeractivity.j;
//        au1 = new au(readeractivity, s1);
//        
//        errorscreen3.a(new OnClickListener(){
//
//			@Override
//			public void onClick(View v) {
//				// TODO Auto-generated method stub
//			    Intent it = new Intent("android.intent.action.VIEW", Uri.parse(s1));
//			    startActivity(it);
//			}});
//        readeractivity.b(2);
    }

    static void a(ReaderActivity readeractivity, boolean flag)
    {
        readeractivity.U = flag;
    }

    private void a(l l1)
    {
        String s1 = l1.c();
        a(s1, l1, false);
    }

    private void a(l l1, String s1, String s2, boolean flag, boolean flag1, boolean flag2)
    {
        ReaderActivity readeractivity = this;
        l l2 = l1;
        String s3 = s1;
        String s4 = s2;
        boolean flag3 = flag;
        boolean flag4 = flag1;
        boolean flag5 = flag2;
        readeractivity.a(l2, s3, s4, flag3, flag4, flag5, false);
    }

    private void a(l l1, String s1, String s2, boolean flag, boolean flag1, boolean flag2, boolean flag3)
    {
        a.stopLoading();
        RILWebView rilwebview = a;
        byte byte0;
        int i1;
        boolean flag4;
        String s3;
        if(S.get() == 1 && al)
            i1 = 0xff000000;
        else
            i1 = -1;
        rilwebview.setBackgroundColor(i1);
        Z.invalidate();
        a.invalidate();
        a.clearView();
        V = false;
        Z.a(0);
        Z.setVisibility(0);
        if(flag2)
            byte0 = 4;
        else
            byte0 = 0;
        if(A.getVisibility() != byte0)
            A.setVisibility(byte0);
        E = false;
        if(s1 != null)
            if(D.size() == 0)
            {
                flag4 = D.add(s1);
            } else
            {
                ArrayList arraylist = D;
                int k1 = D.size() - 1;
                boolean flag5;
                if(!((String)arraylist.get(k1)).equals(s1))
                    flag5 = D.add(s1);
            }
        M = l1;
        N = s1;
        W = flag;
        O = s2;
        s3 = O;
        P = s3;
        if(flag1)
        {
            int j1 = n();
            aa = j1;
            if(!flag3)
            {
                RILWebView rilwebview1 = a;
                String s4 = com.kksoft.readcm.objects.l.g(O);
                rilwebview1.loadUrl(s4);
            } else
            {
                RILWebView rilwebview2 = a;
                String s5 = O;
                String s6 = null;
                rilwebview2.loadDataWithBaseURL(null, s5, "text/html", "UTF-8", s6);
            }
        }
        i();
        j();
    }

    private void a(String s1)
    {
        X = null;
        l l1 = b(s1);
        M = l1;
        String s2 = com.kksoft.readcm.a.Appconfig.getThis().e().a(s1);
        if((new File(s2)).exists())
        {
            String s3 = com.kksoft.readcm.a.c.c(s2);
            ReaderActivity readeractivity = this;
            String s4 = s1;
            boolean flag = true;
            readeractivity.a(null, s4, s3, true, flag, false);
        } else
        {
            X = s1;
            com.kksoft.readcm.a.Appconfig.getThis().d().a(s1);
            String s5 = com.kksoft.readcm.a.c.c(s2);
            ReaderActivity readeractivity1 = this;
            String s6 = s1;
            boolean flag1 = false;
            readeractivity1.a(null, s6, s5, true, flag1, false);
        }
    }

    private void a(String s1, l l1)
    {
        Object obj;
        if(l1 != null)
            obj = l1;
        else
            obj = new l(s1);
        com.kksoft.readcm.a.Appconfig.getThis().getItemAppObservable().a(((l) (obj)), false, true, true);
//        JVM INSTR tableswitch -3 -1: default 48
//    //                   -3 78
//    //                   -2 85
//    //                   -1 78;
//           goto _L1 _L2 _L3 _L2
//_L1:
//        obj = 0x7f070081;
//_L5:
//        Toast.makeText(this, ((int) (obj)), 0).show();
//        k();
//        return;
//_L2:
//        obj = 0x7f070080;
//        continue; /* Loop/switch isn't completed */
//_L3:
//        obj = 0x7f070082;
//        if(true) goto _L5; else goto _L4
//_L4:
    }

    private void a(String s1, l l1, boolean flag)
    {
        t();
        a.setVisibility(0);
        b(1);
        X = null;
        ab = null;
        l l2;
        Object obj;
        if(l1 == null)
            l2 = b(s1);
        else
            l2 = l1;
        if(l2 != null)
            obj = l2.e();
        else
            obj = s1;
        obj = com.kksoft.readcm.objects.u.a(((String) (obj)));
        if(!com.kksoft.readcm.activity.App.isConnectNet())
        {
            if(obj != null)
            {
                obj = 1;
                j.a();
                ErrorScreen errorscreen = j;
                String s2 = a(l2, s1);
                errorscreen.b(s2);
                ErrorScreen errorscreen1 = j;
                String s3 = getString(0x7f070052);
                errorscreen1.a(s3);
                ErrorScreen errorscreen2 = j;
                String s4 = getString(0x7f070053);
                errorscreen2.c(s4);
                b(2);
            } else
            if(l2 != null)
            {
                if(S.get() == 1 && l2.D() == 1 && !Q)
                {
                    b(l2);
                    obj = 0;
                } else
                if(S.get() == 2 && l2.C() == 1 && !Q)
                {
                    c(l2);
                    obj = 0;
                } else
                if(!E && l2.C() == 1 && !Q)
                {
                    a(2, false, true);
                    c(l2);
                    obj = 0;
                } else
                if(!E && l2.D() == 1 && !Q)
                {
                    a(1, false, true);
                    b(l2);
                    obj = 0;
                } else
                {
                    obj = 1;
                    j.a();
                    ErrorScreen errorscreen3 = j;
                    String s6 = a(l2, s1);
                    errorscreen3.b(s6);
                    ErrorScreen errorscreen7;
                    dy dy1;
                    if(Q)
                    {
                        ErrorScreen errorscreen4 = j;
                        String s7 = getString(0x7f0700d8);
                        errorscreen4.a(s7);
                        ErrorScreen errorscreen5 = j;
                        String s8 = getString(0x7f0700e0);
                        errorscreen5.c(s8);
                        ErrorScreen errorscreen6 = j;
                        String s9 = getString(0x7f0700d9);
                        errorscreen6.d(s9);
                    } else
                    if(E)
                    {
                        String s11;
                        Object obj1;
                        String s12;
                        Object aobj[];
                        String s13;
                        ErrorScreen errorscreen8;
                        String s17;
                        Object aobj2[];
                        String s18;
                        ErrorScreen errorscreen9;
                        String s19;
                        if(S.get() == 1)
                        {
                            String s10 = getString(0x7f070009);
                            boolean flag1 = com.kksoft.readcm.activity.App.getSharedPreferences().getBoolean("downloadText", true);
                            s11 = s10;
                            obj1 = flag1;
                        } else
                        {
                            String s20 = getString(0x7f07000a);
                            boolean flag2 = com.kksoft.readcm.activity.App.getSharedPreferences().getBoolean("downloadWeb", true);
                            s11 = s20;
                            obj1 = flag2;
                        }
                        s12 = getString(0x7f0700dc);
                        aobj = new Object[1];
                        aobj[0] = s11;
                        s13 = String.format(s12, aobj);
                        ErrorScreen errorscreen10;
                        String s21;
                        ErrorScreen errorscreen11;
                        String s22;
                        ErrorScreen errorscreen12;
                        String s23;
                        ErrorScreen errorscreen13;
                        String s24;
                        ErrorScreen errorscreen14;
                        String s25;
                        ErrorScreen errorscreen15;
                        String s26;
                        ErrorScreen errorscreen16;
                        String s27;
                        ErrorScreen errorscreen17;
                        dx dx1;
                        Object aobj3[];
                        String s28;
                        ReaderActivity readeractivity1;
                        String s29;
                        ReaderActivity readeractivity2;
                        String s30;
                        String s31;
                        y y1;
                        boolean flag3;
                        String s32;
                        ReaderActivity readeractivity3;
                        String s33;
                        //if(obj1 == 0)
                        {
                            String s14 = String.valueOf(s13);
                            StringBuilder stringbuilder = new StringBuilder(s14);
                            String s15 = getString(0x7f0700dd);
                            Object aobj1[] = new Object[1];
                            aobj1[0] = s11;
                            String s16 = String.format(s15, aobj1);
                            obj1 = stringbuilder.append(s16).toString();
                        } //else
                        {
                            obj1 = s13;
                        }
                        errorscreen8 = j;
                        s17 = getString(0x7f0700db);
                        aobj2 = new Object[1];
                        aobj2[0] = s11;
                        s18 = String.format(s17, aobj2);
                        errorscreen8.a(s18);
                        j.c(((String) (obj1)));
                        errorscreen9 = j;
                        s19 = getString(0x7f0700da);
                        errorscreen9.d(s19);
                        E = false;
                    } else
                    {
//                        errorscreen10 = j;
//                        s21 = getString(0x7f0700d8);
//                        errorscreen10.a(s21);
//                        errorscreen11 = j;
//                        s22 = getString(0x7f0700e1);
//                        errorscreen11.c(s22);
//                        errorscreen12 = j;
//                        s23 = getString(0x7f0700d9);
//                        errorscreen12.d(s23);
                    }
                    errorscreen7 = j;
                    dy1 = new dy(this);
                    errorscreen7.a(dy1);
                    b(2);
                }
            } else
            {
                obj = 1;
                j.a();
//                errorscreen13 = j;
//                s24 = a(l2, s1);
//                errorscreen13.b(s24);
//                errorscreen14 = j;
//                s25 = getString(0x7f0700d8);
//                errorscreen14.a(s25);
//                errorscreen15 = j;
//                s26 = getString(0x7f0700e1);
//                errorscreen15.c(s26);
//                errorscreen16 = j;
//                s27 = getString(0x7f0700d9);
//                errorscreen16.d(s27);
//                errorscreen17 = j;
//                dx1 = new dx(this);
//                errorscreen17.a(dx1);
                b(2);
            }
        } else
        if(obj != null)
        {
//            obj1 = ((u) (obj)).a("100%", "100%");
//            if(((u) (obj)).d() == 2)
//            {
//                ac = null;
//                aobj3 = new Object[1];
//                aobj3[0] = obj1;
//                s28 = String.format("<html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no\" /></head><body style=\"background-color:black;margin:0px;padding:0px;\">%s</body></html>", aobj3);
//                readeractivity1 = this;
//                s29 = s1;
//                readeractivity1.a(l2, s29, s28, false, true, true, true);
//                obj = 0;
//            } else
//            {
//                ac = ((String) (obj1));
//                readeractivity2 = this;
//                s30 = s1;
//                readeractivity2.a(l2, s30, "file:///android_asset/video_embed.html", false, true, true);
//                obj = 0;
//            }
        } else
        if(!flag && l2 != null)
        {
            if(S.get() == 1)
            {
                if(l2.D() == 1 && !Q)
                {
                    b(l2);
                    obj = 0;
                } else
                if(!Q)
                {
                    d(l2);
                    obj = 0;
                } else
                {
//                    s31 = l2.c();
//                    a(s31);
                    obj = 0;
                }
            } else
            if(l2.C() == 1 && !Q)
            {
                c(l2);
                obj = 0;
            } else
            {
                e(l2);
                obj = 0;
            }
        } else
        if(flag && l2 != null)
        {
            if(S.get() == 1)
            {
                d(l2);
                obj = 0;
            } else
            {
//                y1 = com.kksoft.readcm.a.Appconfig.q().d();
//                flag3 = App.k();
//                y1.a(l2, true, flag3, true);
                e(l2);
                obj = 0;
            }
        } else
        if(S.get() == 1)
        {
            a(s1);
            obj = 0;
        } else
        {
//            s32 = com.kksoft.readcm.objects.l.g(s1);
//            readeractivity3 = this;
//            s33 = s1;
//            readeractivity3.a(null, s33, s32, false, true, false);
            obj = 0;
        }
//        if(obj != 0 && !flag)
//        {
//            ReaderActivity readeractivity = this;
//            String s5 = s1;
//            readeractivity.a(l2, s5, null, false, false, false);
//            Z.setVisibility(8);
//        }
    }

    private void a(boolean flag)
    {
        int i1;
        if(flag)
            i1 = 0;
        else
            i1 = 1024;
        getWindow().setFlags(i1, 1024);
    }

    private void a(boolean flag, boolean flag1)
    {
//        if(S.get() != 1) goto _L2; else goto _L1
//_L1:
//        String s1;
//        int j1;
//        if(flag)
//        {
//            int i1 = aj;
//            HashMap hashmap;
//            int k1;
//            Object aobj[];
//            String s2;
//            String s3;
//            String s4;
//            String s5;
//            String s6;
//            String s7;
//            y y1;
//            String s8;
//            y y2;
//            String s9;
//            if(am)
//                s1 = 1;
//            else
//                s1 = 0;
//            if(ak)
//                j1 = 1;
//            else
//                j1 = 0;
//            if(al)
//                k1 = 1;
//            else
//                k1 = 0;
//            aobj = new Object[5];
//            s2 = String.valueOf(i1);
//            aobj[0] = s2;
//            s3 = String.valueOf(s1);
//            aobj[1] = s3;
//            s4 = String.valueOf(j1);
//            aobj[2] = s4;
//            s5 = String.valueOf(k1);
//            aobj[3] = s5;
//            s6 = String.valueOf(android.os.Build.VERSION.SDK_INT);
//            aobj[4] = s6;
//            s7 = String.format("javascript:loadSettings(%s,%s,%s,%s,%s)", aobj);
//            a.loadUrl(s7);
//        }
//        if(!(an & true)) goto _L4; else goto _L3
//_L3:
//        hashmap = null;
//        if(M != null)
//            hashmap = M.L();
//        if(hashmap == null && N != null)
//        {
//            y1 = com.kksoft.readcm.a.Appconfig.q().d();
//            s8 = N;
//            hashmap = y1.b(s8);
//        }
//        ab = hashmap;
//        if(ab == null || ab.size() <= 0) goto _L4; else goto _L5
//_L5:
//        s1 = m();
//        com.kksoft.readcm.a.Appconfig.q().h().a(s1);
//        j1 = ab.values().iterator();
//_L9:
//        if(j1.hasNext()) goto _L6; else goto _L4
//_L4:
//        if(!flag1) goto _L2; else goto _L7
//_L7:
//        hashmap = null;
//        if(M != null)
//            hashmap = M.J();
//        if(hashmap == null)
//        {
//            y2 = com.kksoft.readcm.a.Appconfig.q().d();
//            s9 = N;
//            hashmap = y2.c(s9);
//        }
//        if(hashmap == null || hashmap.size() <= 0) goto _L2; else goto _L8
//_L8:
//        s1 = hashmap.values().iterator();
//_L10:
//        if(s1.hasNext())
//            break MISSING_BLOCK_LABEL_416;
//_L2:
//        return;
//_L6:
//        q q1 = (q)j1.next();
//        am am1 = com.kksoft.readcm.a.Appconfig.q().h();
//        String s10 = q1.a();
//        int l1 = q1.b();
//        int i2 = aa;
//        am1.a(s10, l1, i2, s1);
//          goto _L9
//        u u1 = (u)s1.next();
//        Object aobj1[] = new Object[4];
//        String s11 = String.valueOf(u1.b());
//        aobj1[0] = s11;
//        String s12 = String.valueOf(u1.a());
//        aobj1[1] = s12;
//        String s13 = String.valueOf(u1.d());
//        aobj1[2] = s13;
//        String s14 = String.valueOf(u1.c());
//        aobj1[3] = s14;
//        String s15 = String.format("javascript:loadVideo('%s','%s','%s','%s','0')", aobj1);
//        a.loadUrl(s15);
//          goto _L10
    }

    static boolean a(ReaderActivity readeractivity, String s1, final JsResult jsresult)
    {
    	
        AlertDialog.Builder builder = new android.app.AlertDialog.Builder(readeractivity);
        builder.setMessage(s1)
        		.setTitle(String.format(readeractivity.getString(R.string.dg_jsalert_t), com.kksoft.readcm.objects.l.h(readeractivity.N)))
        		.setPositiveButton(R.string.ac_ok, new DialogInterface.OnClickListener(){

					@Override
					public void onClick(DialogInterface dialog, int which) {
						// TODO Auto-generated method stub
						jsresult.confirm();
					}
        			
        		})
        		.setNegativeButton(R.string.ac_cancel, new DialogInterface.OnClickListener(){

					@Override
					public void onClick(DialogInterface dialog, int which) {
						// TODO Auto-generated method stub
						jsresult.cancel();
						dialog.dismiss();
					}
        			
        		})
        		.setOnCancelListener(new DialogInterface.OnCancelListener(){

					@Override
					public void onCancel(DialogInterface dialog) {
						// TODO Auto-generated method stub
						jsresult.cancel();
					}
        			
        		});
        AlertDialog alertdialog = builder.create();
        alertdialog.setCanceledOnTouchOutside(true);
        alertdialog.show();
        return true;
    }

    static int b(ReaderActivity readeractivity)
    {
        return readeractivity.aj;
    }

    private l b(String s1)
    {
        l l1;
        Q = false;
        l1 = com.kksoft.readcm.a.Appconfig.getThis().getItemAppObservable().a().a(s1, true);
        //break MISSING_BLOCK_LABEL_22;
        if(l1 == null && com.kksoft.readcm.a.Appconfig.getThis().getItemAppObservable().h() != null)
        {
            Q = true;
            l1 = com.kksoft.readcm.a.Appconfig.getThis().getItemAppObservable().h().a(s1, true);
        }
        return l1;
    }

    private String b(Bundle bundle)
    {
        String s1 = getIntent().getStringExtra("item_url");
        if(bundle != null && (s1 == null || s1.length() == 0))
            s1 = bundle.getString("itemUrl");
        if(s1 != null && s1.length() == 0)
            s1 = null;
        return s1;
    }

    private void b(int i1)
    {
//        i1;
//        JVM INSTR tableswitch 1 2: default 24
//    //                   1 54
//    //                   2 25;
//           goto _L1 _L2 _L3
//_L1:
//        return;
//_L3:
//        j.setVisibility(0);
//        a.setVisibility(8);
//        Z.setVisibility(8);
//        continue; /* Loop/switch isn't completed */
//_L2:
//        j.setVisibility(8);
//        a.setVisibility(0);
//        if(true) goto _L1; else goto _L4
//_L4:
    }

    static void b(ReaderActivity readeractivity, float f1)
    {
        readeractivity.af = f1;
    }

    static void b(ReaderActivity readeractivity, int i1)
    {
        readeractivity.ai = i1;
    }

    static void b(ReaderActivity readeractivity, String s1)
    {
//        if(!s1.equals("file:///android_asset/webkit/")) goto _L2; else goto _L1
//_L1:
//        Object obj;
//        Object obj1;
//        obj = 1;
//        obj1 = s1;
//_L4:
//        if(obj != 0)
//        {
//            readeractivity.P = ((String) (obj1));
//            readeractivity.a.loadUrl(((String) (obj1)));
//        }
//        return;
//_L2:
//        if(s1.startsWith("ISRIL"))
//        {
//            if(s1.equals("ISRIL:WEB"))
//                readeractivity.a(2, true, true);
//            obj = 0;
//            obj1 = s1;
//            continue; /* Loop/switch isn't completed */
//        }
//        if(s1.equals("http://ideashower.com/support/read-it-later/report-pages-not-saving-well-offline-here/"))
//        {
//            obj = new Intent("android.intent.action.SEND");
//            Intent intent = ((Intent) (obj)).setType("text/html");
//            Intent intent1 = ((Intent) (obj)).putExtra("android.intent.extra.SUBJECT", "Article View Report");
//            StringBuilder stringbuilder = new StringBuilder("<p>This page's article view did not render correctly:</p><p><a href=\"");
//            String s2 = readeractivity.N;
//            StringBuilder stringbuilder1 = stringbuilder.append(s2).append("\">");
//            String s3 = readeractivity.N;
//            android.text.Spanned spanned = Html.fromHtml(stringbuilder1.append(s3).append("</a></p>").toString());
//            Intent intent2 = ((Intent) (obj)).putExtra("android.intent.extra.TEXT", spanned);
//            String as[] = new String[1];
//            as[0] = "RIL@ideashower.com";
//            Intent intent3 = ((Intent) (obj)).putExtra("android.intent.extra.EMAIL", as);
//            if(App.a(readeractivity, ((Intent) (obj))))
//            {
//                readeractivity.startActivity(((Intent) (obj)));
//            } else
//            {
//                Uri uri = Uri.parse(s1);
//                Intent intent4 = new Intent("android.intent.action.VIEW", uri);
//                readeractivity.startActivity(intent4);
//            }
//            obj = 0;
//            obj1 = s1;
//            continue; /* Loop/switch isn't completed */
//        }
//        if(s1.startsWith("vnd.youtube:"))
//        {
//            Uri uri1 = Uri.parse(s1);
//            obj = new Intent("android.intent.action.VIEW", uri1);
//            if(App.a(readeractivity, ((Intent) (obj))))
//                readeractivity.startActivity(((Intent) (obj)));
//            obj = 0;
//            obj1 = s1;
//            continue; /* Loop/switch isn't completed */
//        }
//        if(s1.startsWith("vnd.youtube:"))
//        {
//            Uri uri2 = Uri.parse(s1);
//            obj = new Intent("android.intent.action.VIEW", uri2);
//            if(App.a(readeractivity, ((Intent) (obj))))
//                readeractivity.startActivity(((Intent) (obj)));
//            obj = 0;
//            obj1 = s1;
//            continue; /* Loop/switch isn't completed */
//        }
//        if(s1.startsWith("mailto:"))
//        {
//            obj = new Intent("android.intent.action.SEND");
//            Intent intent5 = ((Intent) (obj)).setType("plain/text");
//            String as1[] = new String[1];
//            String s4 = s1.replaceFirst("mailto:", "");
//            as1[0] = s4;
//            Intent intent6 = ((Intent) (obj)).putExtra("android.intent.extra.EMAIL", as1);
//            if(App.a(readeractivity, ((Intent) (obj))))
//                readeractivity.startActivity(((Intent) (obj)));
//            obj = 0;
//            obj1 = s1;
//            continue; /* Loop/switch isn't completed */
//        }
//        if(readeractivity.U && readeractivity.Z.a() < 17)
//        {
//            obj = 1;
//            obj1 = s1;
//            continue; /* Loop/switch isn't completed */
//        }
//        if(!readeractivity.W)
//            break; /* Loop/switch isn't completed */
//        String s7;
//        String s5 = readeractivity.N;
//        URL url = new URL(s5);
//        String s6 = s1.replaceFirst("file://", "");
//        s7 = (new URL(url, s6)).toString();
//        obj = s7;
//_L5:
//        obj1 = readeractivity.b(((String) (obj)));
//        if(obj1 != null)
//            readeractivity.a(((l) (obj1)));
//        else
//            readeractivity.a(22, ((String) (obj)), null, null);
//        obj1 = obj;
//        obj = 0;
//        continue; /* Loop/switch isn't completed */
//        com.kksoft.readcm.activity.App.b();
//        break; /* Loop/switch isn't completed */
//        if(true) goto _L4; else goto _L3
//_L3:
//        obj = s1;
//          goto _L5
    }

    static void b(final ReaderActivity readeractivity, boolean flag)
    {
        Object obj;
        if(flag)
        {
            if(readeractivity.M.D() == 1)
            {
                readeractivity.g();
                obj = 0;
            } else
            {
                obj = 1;
            }
        } else
        {
//            c c1 = com.kksoft.readcm.a.Appconfig.q().e();
//            String s6 = readeractivity.X;
//            obj = c1.a(s6);
//            if((new File(((String) (obj)))).exists())
//            {
//                String s7 = readeractivity.X;
//                l l2 = readeractivity.b(s7);
//                String s8 = readeractivity.X;
//                String s9 = com.kksoft.readcm.a.c.c(((String) (obj)));
//                ReaderActivity readeractivity1 = readeractivity;
//                boolean flag1 = true;
//                readeractivity1.a(l2, s8, s9, true, flag1, false);
//                obj = 0;
//            } else
//            {
//                obj = 1;
//            }
        }
//        if(obj != 0)
        {
            readeractivity.j.a();
            ErrorScreen errorscreen = readeractivity.j;
            l l1 = readeractivity.M;
            String s1 = readeractivity.N;
            String s2 = a(l1, s1);
            errorscreen.b(s2);
            ErrorScreen errorscreen1 = readeractivity.j;
            String s3 = readeractivity.getString(0x7f0700e2);
            errorscreen1.a(s3);
            ErrorScreen errorscreen2 = readeractivity.j;
            String s4 = readeractivity.getString(0x7f0700e3);
            errorscreen2.c(s4);
            ErrorScreen errorscreen3 = readeractivity.j;
            String s5 = readeractivity.getString(0x7f07001f);
            errorscreen3.d(s5);
            ErrorScreen errorscreen4 = readeractivity.j;
            errorscreen4.a(new OnClickListener(){

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					ReaderActivity.m(readeractivity);
				}});
            readeractivity.b(2);
        }
        readeractivity.X = null;
    }
    

    private void b(l l1)
    {
        String s1 = l1.c();
//        c c1 = com.kksoft.readcm.a.Appconfig.q().e();
        int i1 = l1.a();
//        String s2 = c1.a(i1);
        ReaderActivity readeractivity = this;
        l l2 = l1;
        boolean flag = true;
//        readeractivity.a(l2, s1, s2, true, flag, false);
    }

    private void b(boolean flag)
    {
    	if(ad != flag)
    	{
    		ad = flag;
          if(flag)
          {
              if(b == null)
              {
                  b = (LinearLayout)((ViewStub)findViewById(R.id.text_styles_stub)).inflate();
                  this.F = (ImageButton)findViewById(R.id.text_decrease);
                  this.F.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						if (ReaderActivity.H(ReaderActivity.this))
					      ReaderActivity.I(ReaderActivity.this);
					}});
                  this.G = (ImageButton)findViewById(R.id.text_increase);
                  this.G.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						if (ReaderActivity.H(ReaderActivity.this))
					      ReaderActivity.J(ReaderActivity.this);
					}});

                  a(aj, aj);
                  H = (ImageButton)findViewById(R.id.text_serif);
                  H.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						if (ReaderActivity.H(ReaderActivity.this))
					      ReaderActivity.K(ReaderActivity.this);
					}});
                  I = (ImageButton)findViewById(R.id.text_justify);
                  I.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						if (ReaderActivity.H(ReaderActivity.this))
					      ReaderActivity.L(ReaderActivity.this);
					}});
                  J = (ImageButton)findViewById(R.id.text_night);
                  J.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						if (ReaderActivity.H(ReaderActivity.this))
					      ReaderActivity.M(ReaderActivity.this);
					}});
              }
              b.setVisibility(0);
              Animation animation = AnimationUtils.loadAnimation(this, R.anim.text_toolbar_up);
              b.startAnimation(animation);
          } else
          if(b != null)
          {
              Animation animation1 = AnimationUtils.loadAnimation(this, R.anim.text_toolbar_down);
              animation1.setAnimationListener(new Animation.AnimationListener(){

				@Override
				public void onAnimationStart(Animation animation) {
					// TODO Auto-generated method stub
					
				}

				@Override
				public void onAnimationEnd(Animation animation) {
					// TODO Auto-generated method stub
					ReaderActivity.this.b.setVisibility(8);
				}

				@Override
				public void onAnimationRepeat(Animation animation) {
					// TODO Auto-generated method stub
					
				}
            	  
              });
              b.startAnimation(animation1);
          }
    	}
    }

    private void c(int i1)
    {
        int j1 = aj + i1;
        int k1 = aj;
        a(j1, k1);
        p();
    }

    static void c(ReaderActivity readeractivity, float f1)
    {
        readeractivity.ag = f1;
    }

    static void c(ReaderActivity readeractivity, int i1)
    {
//        l l1 = com.kksoft.readcm.a.Appconfig.q().c().a(i1);
//        if(l1 != null) goto _L2; else goto _L1
//_L1:
//        readeractivity.finish();
//_L4:
//        return;
//_L2:
//        Object obj = null;
//        readeractivity.h.setDrawingCacheEnabled(true);
//        Object obj1 = readeractivity.h.getDrawingCache();
//        if(obj1 != null)
//            obj = Bitmap.createBitmap(((Bitmap) (obj1)));
//        readeractivity.h.setDrawingCacheEnabled(false);
//        if(obj != null)
//            readeractivity.i.setImageBitmap(((Bitmap) (obj)));
//        readeractivity.a.clearView();
//        readeractivity.D.clear();
//        readeractivity.a(l1);
//        Animation animation;
//        if(i1 == 1)
//            obj = 0x7f040005;
//        else
//            obj = 0x7f040006;
//        obj = AnimationUtils.loadAnimation(readeractivity, ((int) (obj)));
//        ((Animation) (obj)).setFillAfter(true);
//        ((Animation) (obj)).setDuration(400L);
//        if(i1 == 1)
//            obj1 = 0x7f040007;
//        else
//            obj1 = 0x7f040008;
//        animation = AnimationUtils.loadAnimation(readeractivity, ((int) (obj1)));
//        animation.setFillAfter(true);
//        animation.setDuration(400L);
//        readeractivity.i.setVisibility(0);
//        readeractivity.i.startAnimation(((Animation) (obj)));
//        readeractivity.h.startAnimation(animation);
//        if(readeractivity.S.get() == 2 || readeractivity.S.get() == 1 && (l1.s() > 5 || l1.D() != 1))
//        {
//            LayoutInflater layoutinflater = readeractivity.getLayoutInflater();
//            ViewGroup viewgroup = (ViewGroup)readeractivity.findViewById(0x7f0a0061);
//            View view = layoutinflater.inflate(0x7f030011, viewgroup);
//            obj = (TextView)view.findViewById(0x7f0a0062);
//            obj1 = (TextView)view.findViewById(0x7f0a0063);
//            Toast toast;
//            int j1;
//            if(l1.j() == null)
//            {
//                String s1 = l1.e().replace("http://", "").replace("https://", "");
//                ((TextView) (obj)).setText(s1);
//                ((TextView) (obj1)).setVisibility(8);
//            } else
//            {
//                String s2 = l1.j();
//                ((TextView) (obj)).setText(s2);
//                String s3 = l1.e().replace("http://", "").replace("https://", "").replace("http://", "").replace("https://", "");
//                ((TextView) (obj1)).setText(s3);
//            }
//            toast = new Toast(readeractivity);
//            j1 = readeractivity.a.getHeight() / 4;
//            toast.setGravity(17, 0, j1);
//            toast.setDuration(0);
//            toast.setView(view);
//            toast.show();
//        }
//        if(true) goto _L4; else goto _L3
//_L3:
    }

    static void c(ReaderActivity readeractivity, String s1)
    {
        readeractivity.a(s1, ((l) (null)), false);
    }

    private void c(l l1)
    {
//        String s1 = l1.c();
//        c c1 = com.kksoft.readcm.a.Appconfig.q().e();
//        int i1 = l1.a();
//        String s2 = l1.v();
//        String s3 = c1.b(i1, s2);
//        ReaderActivity readeractivity = this;
//        l l2 = l1;
//        boolean flag = true;
//        readeractivity.a(l2, s1, s3, true, flag, false);
    }

    static boolean c(ReaderActivity readeractivity)
    {
        return readeractivity.am;
    }

    static void d(ReaderActivity readeractivity, int i1)
    {
        readeractivity.a(i1, true, false);
    }

    static void d(ReaderActivity readeractivity, String s1)
    {
        readeractivity.a(s1, ((l) (null)));
    }

    private void d(l l1)
    {
//        String s1 = l1.c();
//        X = s1;
//        String s2 = l1.c();
//        c c1 = com.kksoft.readcm.a.Appconfig.q().e();
//        int i1 = l1.a();
//        String s3 = c1.a(i1);
//        ReaderActivity readeractivity = this;
//        l l2 = l1;
//        boolean flag = false;
//        readeractivity.a(l2, s2, s3, true, false, flag);
//        y y1 = com.kksoft.readcm.a.Appconfig.q().d();
//        l l3 = M;
//        y1.a(l3, false, true, true);
    }

    static boolean d(ReaderActivity readeractivity)
    {
        return readeractivity.ak;
    }

    private void e()
    {
        SharedPreferences sharedpreferences = com.kksoft.readcm.activity.App.getSharedPreferences();
        int i1 = sharedpreferences.getInt("readerViewType", 1);
        a(i1);
        int j1 = sharedpreferences.getInt("articleFontSize", 14);
        aj = j1;
        boolean flag = sharedpreferences.getBoolean("articleSerif", true);
        am = flag;
        boolean flag1 = sharedpreferences.getBoolean("articleJustify", true);
        ak = flag1;
        boolean flag2 = sharedpreferences.getBoolean("articleNight", false);
        al = flag2;
        boolean flag3 = sharedpreferences.getBoolean("articleImages", true);
        an = flag3;
    }

    private void e(l l1)
    {
        String s1 = l1.c();
        String s2 = com.kksoft.readcm.objects.l.g(l1.c());
        ReaderActivity readeractivity = this;
        l l2 = l1;
        boolean flag = false;
        readeractivity.a(l2, s1, s2, false, true, flag);
    }

    static boolean e(ReaderActivity readeractivity)
    {
        return readeractivity.al;
    }

    static AnimatedProgressBar f(ReaderActivity readeractivity)
    {
        return readeractivity.Z;
    }

    private void f()
    {
        q = true;
        if(g != null)
        {
            g.onCustomViewHidden();
            g = null;
        }
        c.setVisibility(0);
        d.setVisibility(8);
        a(true);
        if(f != null)
        {
            f.stopPlayback();
            FrameLayout framelayout = d;
            VideoView videoview = f;
            framelayout.removeView(videoview);
            f = null;
        }
        com.kksoft.readcm.a.Appconfig.getThis().d().b(4);
    }

    static String g(ReaderActivity readeractivity)
    {
        return readeractivity.P;
    }

    private void g()
    {
        String s1 = N;
        l l1 = M;
        a(s1, l1, false);
    }

    static String h(ReaderActivity readeractivity)
    {
        return readeractivity.O;
    }

    private boolean h()
    {
        boolean flag;
        if(D.size() > 1)
            flag = true;
        else
            flag = false;
        return flag;
    }

    static ErrorScreen i(ReaderActivity readeractivity)
    {
        return readeractivity.j;
    }

    private void i()
    {
        if(h())
        {
            l.setVisibility(0);
            o.setVisibility(0);
            p.setVisibility(0);
            z.setVisibility(0);
            FrameLayout framelayout = B;
            int i1 = (int)a(81F);
            android.widget.LinearLayout.LayoutParams layoutparams = new android.widget.LinearLayout.LayoutParams(i1, -1, 0F);
            framelayout.setLayoutParams(layoutparams);
        } else
        {
            l.setVisibility(8);
            o.setVisibility(8);
            p.setVisibility(8);
            z.setVisibility(8);
            FrameLayout framelayout1 = B;
            android.widget.LinearLayout.LayoutParams layoutparams1 = new android.widget.LinearLayout.LayoutParams(0, -1, 1F);
            framelayout1.setLayoutParams(layoutparams1);
        }
    }

    static l j(ReaderActivity readeractivity)
    {
        return readeractivity.M;
    }

    private void j()
    {
        if(R1)
            if(M != null && !M.M())
            {
                m.setVisibility(8);
                k.setVisibility(0);
            } else
            {
                k.setVisibility(8);
                m.setVisibility(0);
            }
    }

    static String k(ReaderActivity readeractivity)
    {
        return readeractivity.N;
    }

    private void k()
    {
        if(M == null)
        {
            String s1 = N;
            l l1 = b(s1);
            if(l1 != null)
                M = l1;
        }
        j();
    }

    private void l()
    {
        if(!com.kksoft.readcm.activity.App.isConnectNet())
        {
            showDialog(1);
        } else
        {
            String s1 = N;
            l l1 = M;
            a(s1, l1, true);
        }
    }

    static boolean l(ReaderActivity readeractivity)
    {
        return readeractivity.W;
    }

    private String m()
    {
        int i1 = n();
        aa = i1;
        Object obj;
        String s1;
        String s2;
        if(M != null)
            obj = Integer.valueOf(M.a());
        else
            obj = N;
        s1 = String.valueOf(obj).concat("_");
        s2 = String.valueOf(aa);
        return s1.concat(s2);
    }

    static void m(ReaderActivity readeractivity)
    {
        readeractivity.l();
    }

    private int n()
    {
        float f1 = a.getWidth();
        float f2 = o();
        float f3 = f1 / f2 - 40F;
        float f4 = o();
        return (int)Math.floor(f3 * f4);
    }

    static void n(ReaderActivity readeractivity)
    {
        readeractivity.i();
    }

    private float o()
    {
        return getResources().getDisplayMetrics().density;
    }

    static void o(ReaderActivity readeractivity)
    {
        readeractivity.b(2);
    }

    private void p()
    {
        if(K != null)
        {
            this.u.removeCallbacks(this.K);
        }
        bi bi2 = new bi(this);
        K = bi2;
        this.u.postDelayed(this.K, 6000L);
    }

    static void p(ReaderActivity readeractivity)
    {
        if(readeractivity.R1)
        {
        	if(readeractivity.ac != null)
            {
                readeractivity.a.loadUrl(String.format("javascript:document.body.innerHTML=\"%s\";", readeractivity.ac));
                readeractivity.ac = null;
            }
            readeractivity.Z.setVisibility(8);
            if(!readeractivity.V)
            {
                readeractivity.V = true;
                readeractivity.a(true, true);
            }
        }
        else
        {
        	 readeractivity.R1 = true;
             String s1 = readeractivity.N;
             readeractivity.N = null;
             readeractivity.a(s1, ((l) (null)), false);
        }
    }

    private double q()
    {
        double d2;
        if(a.getScale() < 1F)
        {
            double d1 = a.getScale() * 100F;
            d2 = 100D / d1;
        } else
        {
            d2 = 0x3ff0000000000000L;
        }
        return d2;
    }

    static void q(ReaderActivity readeractivity)
    {
        readeractivity.b(false);
    }

    private int r()
    {
        double d1 = a.getContentHeight();
        double d2 = q();
        double d3 = d1 / d2;
        double d4 = a.getHeight();
        int i1 = (int)Math.round(d3 - d4);
        if(i1 < 0)
            i1 = 0;
        return i1;
    }

    static String r(ReaderActivity readeractivity)
    {
        return readeractivity.X;
    }

    static VideoView s(ReaderActivity readeractivity)
    {
        return readeractivity.f;
    }

    static FrameLayout t(ReaderActivity readeractivity)
    {
        return readeractivity.d;
    }

    private void t()
    {
        int i1 = 0x3f800000;
        boolean flag = false;
        if(M != null && V)
        {
            int j1;
            int i2;
            float f6;
            if(S.get() == 1)
            {
                float f1;
                float f2;
                float f3;
                float f4;
                float f5;
                l l2;
                int j2;
                long l3;
                f f7;
                if(ag < 0F)
                    f1 = 0F;
                else
                    f1 = ag;
                ag = f1;
                f2 = ag;
                f3 = af;
                f4 = f2 + f3;
                f5 = ae;
                f1 = f4 / f5;
                if(f1 > 1F)
                    f1 = 1F;
                f1 = (int)(f1 * 100F);
                if(ag < 150F && f1 <= 5)
                {
                    i2 = 0;
                    f6 = 0;
                    j1 = 0;
                } else
                {
                    int k2 = ah;
                    j1 = ai;
                    i2 = k2;
                    f6 = f1;
                }
            } else
            {
                double d1 = a.getScrollY();
                double d2 = q();
                int k1;
                int l1;
                double d5;
                double d6;
                if(d1 * d2 > 150D)
                {
                    double d3 = a.getScrollY();
                    double d4 = r();
                    l1 = (int)Math.round((d3 / d4) * 100D);
                    if(l1 < 5)
                        l1 = 0;
                } else
                {
                    l1 = 0;
                }
                d5 = a.getScrollY();
                d6 = q();
                k1 = (int)Math.round(d5 * d6);
                if(k1 < 150)
                    k1 = 0;
                i2 = k1;
                f6 = l1;
                j1 = 0;
            }
//            e1 = com.kksoft.readcm.a.Appconfig.q().c();
//            l2 = M;
//            j2 = S.get();
//            l3 = System.currentTimeMillis() / 1000L;
//            f7 = new f(j2, j1, 1, i2, f6, l3);
//            e1.a(l2, f7, false, true);
        }
        T = false;
    }

    static void u(ReaderActivity readeractivity)
    {
        readeractivity.f();
    }

    static void v(ReaderActivity readeractivity)
    {
        readeractivity.a(false);
    }

    static RelativeLayout w(ReaderActivity readeractivity)
    {
        return readeractivity.c;
    }

    static LinearLayout x(ReaderActivity readeractivity)
    {
        return readeractivity.e;
    }

    static boolean y(ReaderActivity readeractivity)
    {
        return readeractivity.V;
    }

    static int z(ReaderActivity readeractivity)
    {
        return readeractivity.aa;
    }

    public final void O()
    {
        dn dn1 = new dn(this);
        runOnUiThread(dn1);
    }

    protected final Intent a(Bundle bundle)
    {
        Intent intent = new Intent(this, LoadingListActivity.class);
        String s1 = b(bundle);
        Intent intent1 = intent.putExtra("item_url", s1);
        Intent intent2 = intent.putExtra("waitingForLoad", 1);
        return intent;
    }

    protected final void a(Menu menu)
    {
        String s1 = getString(0x7f07002f);
        MenuItem menuitem = menu.add(-1, 13, 1, s1).setIcon(0x7f020028);
        String s2 = getString(0x7f070039);
        MenuItem menuitem1 = menu.add(-1, 12, 2, s2).setIcon(0x7f020023);
        String s3 = getString(0x7f07003b);
        MenuItem menuitem2 = menu.add(-1, 14, 3, s3).setIcon(0x7f02002c);
        super.a(menu);
    }

    public final void a(boolean flag, l l1, String s1, String s2)
    {
        C = null;
        if(flag)
            if(l1 != null)
            {
                android.content.pm.PackageManager packagemanager = getPackageManager();
                p p1 = new p(l1, this, packagemanager);
                C = p1;
            } else
            {
                android.content.pm.PackageManager packagemanager1 = getPackageManager();
                p p2 = new p(s1, s2, this, packagemanager1);
                C = p2;
            }
    }

    protected final boolean a(MenuItem menuitem)
    {
		return false;
//        menuitem.getItemId();
//        JVM INSTR tableswitch 12 14: default 32
//    //                   12 40
//    //                   13 83
//    //                   14 92;
//           goto _L1 _L2 _L3 _L4
//_L1:
//        boolean flag = super.a(menuitem);
//_L6:
//        return flag;
//_L2:
//        Intent intent = new Intent(this, com/ideashower/readitlater/activity/EditItemActivity);
//        int i1 = M.a();
//        Intent intent1 = intent.putExtra("item_id", i1);
//        startActivityForResult(intent, 1);
//        flag = true;
//        continue; /* Loop/switch isn't completed */
//_L3:
//        l();
//        flag = true;
//        continue; /* Loop/switch isn't completed */
//_L4:
//        b(true);
//        p();
//        flag = true;
//        if(true) goto _L6; else goto _L5
//_L5:
    }

    protected final boolean c_()
    {
        return true;
    }

    public final void h(int i1)
    {
        eb eb1 = new eb(this);
        runOnUiThread(eb1);
    }

    protected void onActivityResult(int i1, int j1, Intent intent)
    {
        if(i1 == 1 && j1 == -1 && intent.getBooleanExtra("com.kksoft.readcm.activity.resultMarked", false))
            finish();
    }

    public void onBackPressed()
    {
        if(f != null)
        {
            f();
        } else
        {
            Y = true;
            super.onBackPressed();
        }
    }

    public void onConfigurationChanged(Configuration configuration)
    {
        super.onConfigurationChanged(configuration);
    }

    public void onCreate(Bundle bundle)
    {
        
        super.onCreate(bundle);
        Object obj;
        String as[] = new String[3];
        as[0] = getString(R.string.mu_read_now);
        as[1] = getString(R.string.mu_read_later);
        as[2] = getString(R.string.mu_view_browser);
        L = as;
        obj = b(bundle);
        if (obj!=null)
        {
                N = ((String) (obj));
                e();
                h = (FrameLayout)findViewById(R.id.webview_frame);
                i = (ImageView)findViewById(R.id.swipe_screencap);
                i.setAlpha(108);
                j = (ErrorScreen)findViewById(R.id.error_screen);
                j.a(new x(){

					@Override
					public void a(int paramInt) {
						// TODO Auto-generated method stub
						int i = -1;
					    if (paramInt == i)
					      i = 1;
					    ReaderActivity.c(ReaderActivity.this, i);	
					}
                	
                });

                a = (RILWebView)findViewById(R.id.reader);
                a.setLongClickable(true);
                a.setOnLongClickListener(new OnLongClickListener(){

					@Override
					public boolean onLongClick(View v) {
						// TODO Auto-generated method stub
						WebView.HitTestResult hittestresult = ((WebView)v).getHitTestResult();
				        if(hittestresult.getType() == 1 || hittestresult.getType() == 7)
				        {
				            ReaderActivity.b(ReaderActivity.this, hittestresult.getExtra());
				        }
				        return false;
					}
                	
                });
                                                
                //boolean flag = com.kksoft.readcm.activity.App.getSharedPreferences().getBoolean("clearCookies", false);
                long l1 = System.currentTimeMillis();
                long l2 = com.kksoft.readcm.activity.App.getSharedPreferences().getLong("mobileAgentStringReset", 0L);
                SharedPreferences sharedpreferences = com.kksoft.readcm.activity.App.getSharedPreferences();
                String s4 = com.kksoft.readcm.d.i.a;
                if(sharedpreferences.getString("mobileAgentString", s4) != null)
                {
                    long l3 = l1 - 2592000000L;
                    if(l2 >= l3)
                    {
                    	a.getSettings().setPluginsEnabled(true);
                        a.getSettings().setJavaScriptEnabled(true);
                        a.getSettings().setLoadWithOverviewMode(true);
                        a.getSettings().setUseWideViewPort(true);
                        a.getSettings().setCacheMode(2);
                        WebSettings localWebSettings = this.a.getSettings();
                        boolean flag2;
                        if(S.get() == 2)
                            flag2 = true;
                        else
                            flag2 = false;
                        localWebSettings.setBuiltInZoomControls(flag2);
                        
                        this.a.setWebChromeClient(new WebChromeClient(){

							@Override
							public void onProgressChanged(WebView view,
									int newProgress) {
								// TODO Auto-generated method stub
								if(ReaderActivity.r(ReaderActivity.this) == null)
						        {
						            ReaderActivity.f(ReaderActivity.this).a(newProgress);
						            if(newProgress == 100)
						                ReaderActivity.f(ReaderActivity.this).setVisibility(8);
						        } else
						        {
						            ReaderActivity.f(ReaderActivity.this).a(0);
						        }
							}

							@Override
							public void onShowCustomView(View view,
									CustomViewCallback callback) {
								// TODO Auto-generated method stub
								if(ReaderActivity.s(ReaderActivity.this) == null)
								{
									if(view instanceof FrameLayout)
							        {
										FrameLayout view1 = (FrameLayout)view;
							            if(view1.getFocusedChild() instanceof VideoView)
							            {
							                ReaderActivity.a(ReaderActivity.this, (VideoView)view1.getFocusedChild());
							                ReaderActivity.t(ReaderActivity.this).addView(view1);
							                VideoView videoview1 = ReaderActivity.s(ReaderActivity.this);
							                videoview1.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){

												@Override
												public void onCompletion(
														MediaPlayer arg0) {
													// TODO Auto-generated method stub
													ReaderActivity.u(ReaderActivity.this);
												}
							                	
							                });
							                
							                videoview1.setOnErrorListener(new MediaPlayer.OnErrorListener(){

												@Override
												public boolean onError(
														MediaPlayer arg0,
														int arg1, int arg2) {
													// TODO Auto-generated method stub
													String s;
													switch(arg1)
													{
													default:
														 s = "There was an error playing this video.";
														 break;
													    case 100:
													    	s = "There was an error playing this video. Connection lost or could not be made";
													    	break;
													}
												
											        AlertDialog.Builder builder = new AlertDialog.Builder(ReaderActivity.this);
											        builder.setTitle(ReaderActivity.this.getString(R.string.dg_video_error_t))
											        .setMessage(s)
											        .setNeutralButton(R.string.ac_ok, new DialogInterface.OnClickListener(){

														@Override
														public void onClick(
																DialogInterface dialog,
																int which) {
															// TODO Auto-generated method stub
															ReaderActivity.u(ReaderActivity.this);
															dialog.dismiss();
														}
											        	
											        })
											        .setOnCancelListener(new DialogInterface.OnCancelListener(){

														@Override
														public void onCancel(
																DialogInterface dialog) {
															// TODO Auto-generated method stub
															ReaderActivity.u(ReaderActivity.this);
														}
											        	
											        });
											        AlertDialog alertdialog = builder.create();
											        alertdialog.setCanceledOnTouchOutside(true);
											        alertdialog.show();
											        return true;
											       
												}
							                	
							                });
							                
							                ReaderActivity.a(ReaderActivity.this, callback);
							                com.kksoft.readcm.a.Appconfig.getThis().d().a(4);
							                ReaderActivity.v(ReaderActivity.this);
							                ReaderActivity.t(ReaderActivity.this).setVisibility(0);
							                ReaderActivity.w(ReaderActivity.this).setVisibility(8);
							                ReaderActivity.s(ReaderActivity.this).start();
							                ReaderActivity.this.q = false;
							            }
							        }
								}
								else
								{
									callback.onCustomViewHidden();
								}
							}

							@Override
							public void onHideCustomView() {
								// TODO Auto-generated method stub
								super.onHideCustomView();
							}

							@Override
							public boolean onJsAlert(WebView view, String url,
									String message, JsResult result) {
								// TODO Auto-generated method stub
								return ReaderActivity.a(ReaderActivity.this, message, result);
							}

							@Override
							public boolean onJsConfirm(WebView view,
									String url, String message, JsResult result) {
								// TODO Auto-generated method stub
								return ReaderActivity.a(ReaderActivity.this, message, result);
							}

							@Override
							public boolean onJsPrompt(WebView view, String url,
									String message, String defaultValue,
									JsPromptResult result) {
								// TODO Auto-generated method stub
								return ReaderActivity.a(ReaderActivity.this, message, result);
							}

							@Override
							public boolean onJsTimeout() {
								// TODO Auto-generated method stub
								return true;
							}

							@Override
							public View getVideoLoadingProgressView() {
								// TODO Auto-generated method stub
								if (ReaderActivity.x(ReaderActivity.this) == null)
								{
								      LayoutInflater localLayoutInflater = LayoutInflater.from(ReaderActivity.this);
								      LinearLayout localLinearLayout = (LinearLayout)localLayoutInflater.inflate(R.layout.video_loading_progress, null);
								      ReaderActivity.a(ReaderActivity.this, localLinearLayout);
								}
								return ReaderActivity.x(ReaderActivity.this);
							}
                        	
                        });
                        
                        this.a.setWebViewClient(new WebViewClient(){

							@Override
							public boolean shouldOverrideUrlLoading(
									WebView view, String url) {
								// TODO Auto-generated method stub
								ReaderActivity.b(ReaderActivity.this, url);
								return true;
							}

							@Override
							public void onPageStarted(WebView view, String url,
									Bitmap favicon) {
								// TODO Auto-generated method stub
							    ReaderActivity.a(ReaderActivity.this, 1);
							    super.onPageStarted(view, url, favicon);
							    ReaderActivity.f(ReaderActivity.this).setVisibility(0);
							}

							@Override
							public void onPageFinished(WebView view, String url) {
								// TODO Auto-generated method stub
							    ReaderActivity.a(ReaderActivity.this, 0);
							    super.onPageFinished(view, url);
							    if (ReaderActivity.g(ReaderActivity.this) != null)
							    {
							      String str = ReaderActivity.g(ReaderActivity.this);
							      if (!url.equals(str));
							    }
							    else
							    {
							      ReaderActivity.p(ReaderActivity.this);
							    }
							}

							@Override
							public void onReceivedError(WebView view,
									int errorCode, String description,
									String failingUrl) {
								// TODO Auto-generated method stub
								 ReaderActivity.g(ReaderActivity.this);
								 String s3 = ReaderActivity.h(ReaderActivity.this);
								 if(failingUrl.equals(s3))
								 {
									 if(!(errorCode != 65522 && errorCode != 65523 || !com.kksoft.readcm.a.Appconfig.getThis().e().e()))
									 {
										 switch(com.kksoft.readcm.a.Appconfig.getThis().e().f())
										 {
										 default:
											 break;
										 case 1:
											 break;
										 case 2:
											 ReaderActivity.this.showDialog(9);
											 break;
										 case 3:
											 ReaderActivity.this.showDialog(10);
											 break;
										 }
										 
									 }
									 switch(errorCode)
									 {
									 default:
										 ReaderActivity.i(ReaderActivity.this).a();
									        ErrorScreen errorscreen = ReaderActivity.i(ReaderActivity.this);
									        String s4;
									        if(ReaderActivity.j(ReaderActivity.this) != null)
									            s4 = ReaderActivity.j(ReaderActivity.this).l();
									        else
									            s4 = ReaderActivity.k(ReaderActivity.this);
									        errorscreen.a(s4);
									        ReaderActivity.i(ReaderActivity.this).c(String.format(ReaderActivity.this.getString(R.string.re_problem_opening_t), description));
									        if(ReaderActivity.l(ReaderActivity.this))
									            s4 = ReaderActivity.this.getString(R.string.mu_reload);
									        else
									            s4 = ReaderActivity.this.getString(R.string.mu_redownload);
									        ReaderActivity.i(ReaderActivity.this).d(s4);
									        ReaderActivity.i(ReaderActivity.this).a(new View.OnClickListener(){

												@Override
												public void onClick(View v) {
													// TODO Auto-generated method stub
													ReaderActivity.m(ReaderActivity.this);
												}
									        	
									        });
										 break;
									 case -12 -10 -3 -1:
										 ReaderActivity.a(ReaderActivity.this, failingUrl);
										 ReaderActivity.n(ReaderActivity.this);
									        ReaderActivity.o(ReaderActivity.this);
										 break;
									 }
								 }
								 
							}
                        	
                        });
                        
                        this.a.a(new com.kksoft.readcm.views.a(){

							@Override
							public void a() {
								// TODO Auto-generated method stub
								if ((ReaderActivity.y(ReaderActivity.this)) && (ReaderActivity.a(ReaderActivity.this).get() == 1))
								    {
								      int i = ReaderActivity.z(ReaderActivity.this);
								      int j = ReaderActivity.A(ReaderActivity.this);
								      if (i != j)
								        ReaderActivity.B(ReaderActivity.this);
								    }
							}
                        	
                        });
                        this.a.setPictureListener(new PictureListener(){

							@Override
							public void onNewPicture(WebView view,
									Picture picture) {
								// TODO Auto-generated method stub
								ReaderActivity.C(ReaderActivity.this);
							}
                        });
                        
                        this.a.setDownloadListener(new DownloadListener(){

							@Override
							public void onDownloadStart(String url,
									String userAgent,
									String contentDisposition, String mimetype,
									long contentLength) {
								// TODO Auto-generated method stub
								ReaderActivity.a(ReaderActivity.this, url);
							}
                        	
                        });

                        this.a.a(new z(){

							@Override
							public void a() {
								// TODO Auto-generated method stub
								ReaderActivity.q(ReaderActivity.this);
							}

							@Override
							public void a(int paramInt) {
								// TODO Auto-generated method stub
								int i = -1;
							    if ((ReaderActivity.a(ReaderActivity.this).get() == 1) || (ReaderActivity.this.a.a()))
							    {
							      ReaderActivity localReaderActivity = ReaderActivity.this;
							      if (paramInt == -1)
							        i = 1;
							      ReaderActivity.c(localReaderActivity, i);
							    }
							}
                        	
                        });

                        this.a.setScrollBarStyle(0);
                        this.a.addJavascriptInterface(new ReadItLaterJSMethods(), "ReadItLaterJSMethods");

                        this.c = (RelativeLayout)findViewById(R.id.reader_root);
                        this.d = (FrameLayout)findViewById(R.id.video_view);
                        this.k = (ImageButton)findViewById(R.id.button_mark);
                        this.k.setOnClickListener(new OnClickListener(){

							@Override
							public void onClick(View v) {
								// TODO Auto-generated method stub
								ReaderActivity.D(ReaderActivity.this);
							}
                        	
                        });

                        this.l = (ImageButton)findViewById(R.id.button_back);
                        this.l.setOnClickListener(new OnClickListener(){

							@Override
							public void onClick(View v) {
								// TODO Auto-generated method stub
								ReaderActivity.E(ReaderActivity.this);
							}
                        	
                        });
                      
                        this.m = (ImageButton)findViewById(R.id.button_add);
                        this.m.setOnClickListener(new OnClickListener(){

							@Override
							public void onClick(View v) {
								// TODO Auto-generated method stub
								ReaderActivity.F(ReaderActivity.this);
							}
                        	
                        });
                       
                        this.n = (ImageButton)findViewById(R.id.button_share);
                        this.n.setOnClickListener(new OnClickListener(){

							@Override
							public void onClick(View v) {
								// TODO Auto-generated method stub
								if(ReaderActivity.G(ReaderActivity.this) == null)
						            if(ReaderActivity.j(ReaderActivity.this) != null)
						            {
						                ReaderActivity.a(ReaderActivity.this, new p(ReaderActivity.j(ReaderActivity.this), ReaderActivity.this, ReaderActivity.this.getPackageManager()));
						            } else
						            {
						                ReaderActivity.a(ReaderActivity.this, new p(ReaderActivity.k(ReaderActivity.this), ReaderActivity.this.a.getTitle(), ReaderActivity.this, ReaderActivity.this.getPackageManager()));
						            }
							}
                        	
                        });
                        
                        this.A = (Toggle)findViewById(R.id.toggle);
                        this.B = (FrameLayout)findViewById(R.id.toggle_container);
                        if(S.get() == 1)
                            A.a(true);
                        else
                            A.a(false);
                        this.A.a(new aa(){

							@Override
							public void a(boolean flag) {
								// TODO Auto-generated method stub
								if(flag)
						            ReaderActivity.d(ReaderActivity.this, 1);
						        else
						            ReaderActivity.d(ReaderActivity.this, 2);
							}
                        	
                        });
                        
                        this.Z = (AnimatedProgressBar)findViewById(R.id.reader_progress);
                        this.o = findViewById(R.id.reader_spacer_between_back_and_addmark);
                        this.p = findViewById(R.id.reader_spacer_between_addmark_and_toggle);
                        this.z = findViewById(R.id.reader_spacer_between_toggle_and_share);
                        this.a.loadUrl("file:///android_asset/blank.html");
                    }
                }
                App.getSharedPreferences().edit()
                	.putString("mobileAgentString", this.a.getSettings().getUserAgentString())
                	.putLong("mobileAgentStringReset", l1)
                	.commit();
        }
        else
        {
        	Intent intent = new Intent(this, HomeActivity.class);
            startActivity(intent);
            finish();
        }
    }
    protected Dialog onCreateDialog(int i1)
    {
		switch(i1)
		{
		default:
			return super.onCreateDialog(i1);
		case 22:
			AlertDialog.Builder builder=new android.app.AlertDialog.Builder(this);
			builder.setTitle(y.a(i1));
			Dialog dialog=builder.setItems(L, new ed(this, y.a(i1))).create();
			dialog.setOnDismissListener(new ec(this, i1));
			return dialog;
		}
    }

    public void onPause()
    {
        t();
        super.onPause();
        a.clearCache(true);
        com.kksoft.readcm.a.Appconfig.getThis().d().b(4);
        com.kksoft.readcm.activity.g g1 = new com.kksoft.readcm.activity.g(this);
        Void avoid[] = new Void[0];
        AsyncTask asynctask = g1.execute(avoid);
    }

    public boolean onPrepareOptionsMenu(Menu menu)
    {
        boolean flag = super.onPrepareOptionsMenu(menu);
        MenuItem menuitem = menu.findItem(12);
        CharSequence charsequence;
        MenuItem menuitem1;
        MenuItem menuitem2;
        MenuItem menuitem3;
//        if(M != null && !M.M())
//            charsequence = 1;
//        else
//            charsequence = 0;
//        menuitem1 = menuitem.setEnabled(charsequence);
//        menuitem = menu.findItem(14);
//        if(S.get() == 1 && !ad)
//            charsequence = 1;
//        else
//            charsequence = 0;
//        menuitem2 = menuitem.setEnabled(charsequence);
//        menuitem = menu.findItem(13);
//        if(W)
//            charsequence = getString(0x7f070030);
//        else
//            charsequence = getString(0x7f07002f);
//        menuitem3 = menuitem.setTitle(charsequence);
        return true;
    }

    protected void onRestart()
    {
        super.onRestart();
        e();
    }

    protected void onRestoreInstanceState(Bundle bundle)
    {
        super.onRestoreInstanceState(bundle);
    }

    public void onResume()
    {
        super.onResume();
        WebSettings websettings = a.getSettings();
//        String s1 = com.kksoft.readcm.activity.App.i();
//        websettings.setUserAgentString(s1);
        k();
    }

    protected void onSaveInstanceState(Bundle bundle)
    {
        String s1 = N;
        bundle.putString("itemUrl", s1);
        super.onSaveInstanceState(bundle);
    }

    protected void onStop()
    {
        super.onStop();
        if(Y)
        {
            a.stopLoading();
            a.loadUrl("about:blank");
        }
    }

    protected final int s()
    {
        return 0x7f030007;
    }

    public void update(Observable observable, final Object obj)
    {
    	GlobalVar h1 = GlobalVar.a(obj);
        if(h1.a() == 12 || h1.a() == 36 || h1.a() == 40)
        {
            ef ef1 = new ef(this, h1);
            runOnUiThread(new Runnable(){

				@Override
				public void run() {
					// TODO Auto-generated method stub
					switch (GlobalVar.a(obj).a())
					{
						default:
							break;
						case 1:
						case 2:
						case 22:
							 ReaderActivity.N(ReaderActivity.this);
							break;
						case 12:
						case 36:
							com.kksoft.readcm.b.h h1 = (com.kksoft.readcm.b.h)GlobalVar.a(obj).d();
					        if(!(ReaderActivity.r(ReaderActivity.this) == null || h1.d() != 1))
					        if(h1.t() != null && com.kksoft.readcm.activity.ReaderActivity.j(ReaderActivity.this) != null)
					        {
					            int i = com.kksoft.readcm.activity.ReaderActivity.j(ReaderActivity.this).a();
					            int k = h1.t().a();
					            if(i == k)
					            {
					                ReaderActivity.b(ReaderActivity.this, true);
					            }
					        }
					        String s = ReaderActivity.r(ReaderActivity.this);
					        String s1 = h1.s();
					        if(s.equals(s1))
					            ReaderActivity.b(ReaderActivity.this, false);
							break;
						case 40:
					        j j1 = (j)GlobalVar.a(obj).d();
					        ReaderActivity.a(ReaderActivity.this, j1);
							break;
					}
				}});
        }
        super.update(observable, obj);
    }

    private Toggle A;
    private FrameLayout B;
    private p C;
    private ArrayList D;
    private boolean E;
    private ImageButton F;
    private ImageButton G;
    private ImageButton H;
    private ImageButton I;
    private ImageButton J;
    private bi K;
    private String L[];
    private l M;
    private String N;
    private String O;
    private String P;
    private boolean Q;
    private boolean R1;   //old R
    private AtomicInteger S;
    private boolean T;
    private boolean U;
    private boolean V;
    private boolean W;
    private String X;
    private boolean Y;
    private AnimatedProgressBar Z;
    public RILWebView a;
    private int aa;
    private HashMap ab;
    private String ac;
    private boolean ad;
    private float ae;
    private float af;
    private float ag;
    private int ah;
    private int ai;
    private int aj;
    private boolean ak;
    private boolean al;
    private boolean am;
    private boolean an;
    public LinearLayout b;
    private RelativeLayout c;
    private FrameLayout d;
    private LinearLayout e;
    private VideoView f;
    private android.webkit.WebChromeClient.CustomViewCallback g;
    private FrameLayout h;
    private ImageView i;
    private ErrorScreen j;
    private ImageButton k;
    private ImageButton l;
    private ImageButton m;
    private ImageButton n;
    private View o;
    private View p;
    private View z;

    private class ReadItLaterJSMethods
    {

        public int getScrollableHeight()
        {
			return 0;
            //return a.a.getContentHeight();
        }

        public boolean isConnected()
        {
        	return App.isConnectNet();
        }

        public void log(String s1)
        {
        }

        public void readerNeedsLayout()
        {
            //a.a.loadUrl("javascript:relayout()");
        }

        public void reportingScroll(float f1, float f2, float f3, int i1, int j1)
        {
            ReaderActivity.a(a, f1);
            com.kksoft.readcm.activity.ReaderActivity.b(a, f2);
            com.kksoft.readcm.activity.ReaderActivity.c(a, f3);
            ReaderActivity.a(a, i1);
            com.kksoft.readcm.activity.ReaderActivity.b(a, j1);
        }

        private ReaderActivity a;

        public ReadItLaterJSMethods()
        {
        	super();
            a = ReaderActivity.this;
            
        }
    }

}